<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <ui:composition template="/view/template.xhtml">
        <ui:define  name="content">
            <f:view>
                <h:form id="form1">
                    <p:dataTable id="systemproperties" value="#{systemPropertyManager.systemPropertyList}" var="item"
                                 selection="#{systemPropertyManager.selectedProperty}" selectionMode="single"
                                 update="form1:display" dynamic="true"
                                 onselectComplete="editDiaglog.show()">
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="名称"/>
                            </f:facet>
                            <h:outputText value="#{item.name}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="值"/>
                            </f:facet>
                            <h:outputText value="#{item.value}"/>
                        </p:column>
                    </p:dataTable>

                    <p:dialog header="编辑属性" widgetVar="editDiaglog"
                              modal="true" draggable="false" width="250">
                        <h:panelGrid  columns="2" id="display">
                            <h:outputLabel value="#{systemPropertyManager.selectedProperty.name}"></h:outputLabel>
                            <h:inputText value="#{systemPropertyManager.selectedProperty.value}"></h:inputText>
                            <f:facet name="footer">
                                <h:panelGroup>
                                    <p:commandButton value="保存" actionListener="#{systemPropertyManager.save}" update="form:growl,form1:systemproperties" oncomplete="editDiaglog.hide()"></p:commandButton>
                                    <p:commandButton value="取消" onclick="editDiaglog.hide()"></p:commandButton>
                                </h:panelGroup>
                            </f:facet>
                        </h:panelGrid>
                    </p:dialog>
                </h:form>
            </f:view>
        </ui:define>
    </ui:composition>
</html>
